# -*- python -*-

# #############################
# Build the walidomains library

import os,platform

Import('WaliDir')
Import('LibInstallDir')
Import('ThirdPartyDir')
Import('MkStatic')
Import('BaseEnv')
Import('Debug')

if Debug:
    print '\n+++ Entered "#/AddOns/Domains/Source/SConscript"\n'



walidomains_files = Split("""
./wali/domains/binrel/BinRel.cpp
./wali/domains/binrel/ProgramBddContext.cpp
./wali/domains/binrel/nwa_detensor.cpp
./wali/domains/reach/Reach.cpp
./wali/domains/lh/LH.cpp
./wali/domains/lh/PhaseLH.cpp
./wali/domains/matrix/Matrix.cpp
""")

env = BaseEnv.Clone()

built = []

# BinRel needs glog. Make sure that glog is built in ThirdParty
ListOfBuilds = ['glog']
[(glog_lib,glog_inc)] = SConscript(os.path.join(ThirdPartyDir,'SConscript'), 'ListOfBuilds')

# Disable warnings because of BuDDy
env["WARNING_FLAGS"]="-Werror"

#buddy headers include path
env.Append(CPPPATH=[os.path.join(WaliDir , 'AddOns', 'Domains' , 'ThirdParty', 'include')]) 
#glog include path
#env.Append(CPPPATH=[os.path.join(ThirdPartyDir, 'include')])
env.Append(CPPPATH=[os.path.join(WaliDir , 'AddOns', 'Domains' , 'Source')])
env.Append(CPPPATH=[glog_inc])

if MkStatic:
  walidomains = env.StaticLibrary('walidomains' , walidomains_files)
  i = env.Install(LibInstallDir, walidomains)
  built += i
  Return('built')
else:
  walidomains = env.SharedLibrary('walidomains' , walidomains_files, LIBS=["boost_serialization"])
  i = env.Install(LibInstallDir, walidomains)
  built += i
  Return('built')


